package com.opennews.openplatform.config;

import com.opennews.openplatform.myspringbootcore.security.AuthRequestValidator;
import com.opennews.openplatform.myspringbootcore.security.RequestMapManager;
import com.opennews.openplatform.myspringbootcore.security.TokenManager;
import com.opennews.openplatform.security.SecurityActiveTokenManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

@Configuration
public class AuthRequestValidatorConfig {
    @Bean
    public AuthRequestValidator authRequestValidator(Environment env,
                                                     RequestMapManager requestMapManager,
                                                     SecurityActiveTokenManager securityActiveTokenManager,
                                                     TokenManager tokenManager) {
        return new AuthRequestValidator(env, requestMapManager, securityActiveTokenManager, tokenManager, WebConfig.API_PATH_PREFIX);
    }
}
